<?php
use app\models\Activity;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;

/* @var $model \app\models\Activity */
/* @var $user \app\models\User */
/* @var $this \yii\web\View */
?>
    <section class="ui-container">

        <div class="ui-form defaultForm">
            <?php $form = ActiveForm::begin(['id' => 'activityForm', 'enableClientScript' => FALSE]); ?>
            <div class="ui-form-item ui-border-b">
                <label class="ico-edit">&nbsp;</label>
                <?= Html::activeTextInput($model, 'title', ['placeholder' => '请输入活动名称', 'data-required' => 'true']); ?>
            </div>

            <?php if ($model->isNewRecord): ?>
                <div class="ui-form-item ui-border-b">
                    <label class="ico-edit">&nbsp;</label>
                    <?= \app\widgets\LayDateWidget::widget([
                        'model' => $model,
                        'attribute' => 'start_time',
                        'options' => [
                            'placeholder' => '请选择活动开始时间',
                            'data-required' => 'true'
                        ]
                    ]); ?>
                </div>

                <div class="ui-form-item ui-border-b">
                    <label class="ico-edit">&nbsp;</label>
                    <?= \app\widgets\LayDateWidget::widget([
                        'model' => $model,
                        'attribute' => 'end_time',
                        'options' => [
                            'placeholder' => '请选择活动结束时间',
                            'data-required' => 'true'
                        ]
                    ]); ?>
                </div>
            <?php endif; ?>

            <div class="ui-form-item ui-border-b">
                <label class="ico-edit">&nbsp;</label>
                <?= Html::activeTextInput($model, 'tel', ['placeholder' => '请输入主办方电话', 'data-required' => 'true']); ?>
            </div>

            <div class="ui-form-item ui-border-b">
                <label class="ico-edit">&nbsp;</label>
                <?= Html::activeTextInput($model, 'address', ['placeholder' => '请输入活动地址', 'data-required' => 'true']); ?>
            </div>

            <div class="ui-form-item ui-border-b">
                <label class="ico-edit">&nbsp;</label>
                <?= Html::activeTextInput($model, 'number', ['placeholder' => '请输入活动人数(0不限人数)', 'data-required' => 'true']); ?>
            </div>

            <?php if (intval($model->type) === intval(Activity::TYPE_SAI_SHI)): ?>
                <div class="ui-form-item ui-border-b">
                    <label class="ico-edit">&nbsp;</label>
                    <?= Html::activeTextInput($model, 'condition', ['placeholder' => '请输入学校学生要求', 'data-required' => 'true']); ?>
                </div>
            <?php endif; ?>

            <div class="ui-form-item ui-form-item-title" style="margin-top: 10px;"><label
                        class="ico-edit">&nbsp;</label><span>详细内容</span></div>
            <div class="ui-form-item ui-form-item-textarea">
                <?= Html::activeTextarea($model, 'content', ['rows' => 20]); ?>
            </div>

            <div class="ui-form-item ui-form-item-title"><label class="ico-edit">&nbsp;</label><span>上传图片</span></div>
            <div class="ui-form-item ui-form-item-textarea">
                <div class="uploader__bd">
                    <ul class="uploader__files" id="uploaderFiles">
                    </ul>
                    <div class="uploader__input-box">
                        <button type="button" id="uploaderInput" class="uploader__input"></button>
                    </div>
                </div>
            </div>
            <div class="ui-btn-wrap">
                <button data-redirect="<?= Url::to(['user/publish']); ?>" class="loginSubmit" type="submit">发布</button>
            </div>
            <?php ActiveForm::end(); ?>
        </div>
    </section>
<?= \app\widgets\WxJsWidget::widget(); ?>